<style>
	.box-body{width: 800px;}
	
</style>
    <input type="hidden" id="type" name="type" value="<{$type}>" />
    
        <div class="box-body">
            <table class="table ">
                <colgroup>
                    <col style="width: 25%;"></col>
                    <col style="width: 80%;"></col>
                </colgroup>

                <tr>
                    <th class="th-label" style="border: none;background-color: #FFFFFF;">常规跨服数量限制：</th>
                    <td style="border: none;">
                        <input class="form-control inline" type="number" name="routine_num" id="routine_num" value="<{$data.routine_num}>" />
                    </td>
                </tr>
                
                <tr>
                    <th class="th-label" style="border: none;background-color: #FFFFFF;">匹配跨服自动分组数量：</th>
                    <td style="border: none;">
                        <input class="form-control inline" type="number" name="match_automatic_num" id="match_automatic_num" value="<{$data.match_automatic_num}>" />
                    </td>
                </tr>
                
                <tr>
                    <th class="th-label" style="border: none;background-color: #FFFFFF;">匹配跨服上限数量限制：</th>
                    <td style="border: none;">
                        <input class="form-control inline" type="number" name="match_manual_operation_num" id="match_manual_operation_num" value="<{$data.match_manual_operation_num}>" />
                    </td>
                </tr>
                
                <tr>
                    <th class="th-label" style="border: none;background-color: #FFFFFF;">跨服预备周期：</th>
                    <td style="border: none;">
                        <input class="form-control inline" type="number" name="cycle" id="cycle" value="<{$data.cycle}>" />&nbsp;天
                    </td>
                </tr>
                
                <tr>
                    <th class="th-label" style="border: none;background-color: #FFFFFF;">跨服重置时间：</th>
                    <td style="border: none;">
                        <input class="form-control inline" type="text" name="reset_time" id="reset_time" value="<{$data.reset_time}>" />
                    </td>
                </tr>

                

            </table>
        </div>

        <div class="box-footer">
            <button type="button" id="sub" class="btn btn-default" style="margin-left: 84px;">保存</button>
        </div>
    
<script>
	$("#reset_time").datetimepicker({
        format: 'yyyy-mm-dd hh:ii:00',
    });
        
	$(document).on('click','#sub',function(){
        	var g = $('input[name="g"]').val();
	        var url = '?r=system/doEdit&g='+g;
        	
        	var type = $('input[name="type"]').val();
        	var routine_num = $('input[name="routine_num"]').val();
        	var match_automatic_num = $('input[name="match_automatic_num"]').val();
        	var match_manual_operation_num = $('input[name="match_manual_operation_num"]').val();
        	var cycle = $('input[name="cycle"]').val();
        	var reset_time = $('input[name="reset_time"]').val();
        	if(type == ''){
        		layer.alert('非法操作', {icon: 2, skin: 'layui-layer-molv'});
        		return false;
        	}
        	if(routine_num == ''){
        		layer.alert('请填写常规跨服数量限制', {icon: 2, skin: 'layui-layer-molv'});
        		return false;
        	}      	
        	
        	if(match_automatic_num == ''){
        		layer.alert('请填写匹配跨服自动数量限制', {icon: 2, skin: 'layui-layer-molv'});
        		return false;
        	}
        	
        	if(match_manual_operation_num == ''){
        		layer.alert('请填写匹配跨服手动数量限制', {icon: 2, skin: 'layui-layer-molv'});
        		return false;
        	}
        	
        	if(cycle == ''){
        		layer.alert('请填写跨服预备周期', {icon: 2, skin: 'layui-layer-molv'});
        		return false;
        	}
        	
        	if(reset_time == ''){
        		layer.alert('请填写跨服重置时间', {icon: 2, skin: 'layui-layer-molv'});
        		return false;
        	}
        	
          	$.ajax({
	        	type : 'POST',
	        	url : url,
	        	async:false,
	        	data : {'type':type,'routine_num':routine_num,'match_automatic_num':match_automatic_num,'match_manual_operation_num':match_manual_operation_num,'cycle':cycle,'reset_time':reset_time},
		        dataType :'JSON',
		        success : function(res){
		        	if(res.status){		
					   layer.alert('设置成功', {icon: 1, skin: 'layui-layer-molv'});
			        }else{
			        	layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
			        	
			        }
		        }
	        });
    });
</script>